package com.yny.administrator.android1607_meishi.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/9/19.
 */
public class MyVpAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList;
    private String [] mTitles;
    public MyVpAdapter(FragmentManager fm,List<Fragment> list,String [] titles) {
        super(fm);
        this.mList=list;
        this.mTitles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return mTitles[position];
    }
}
